<template>
  <div class="banner">
    <div class="banner-item" :style="{ backgroundImage: `url(${bgImg})` }">
      <a-input-search
        placeholder="请输入关键字搜索"
        enter-button
        @search="onSearch"
        v-if="search"
        class="banner-search"
      />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    bgImg: String,
    search: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    onSearch(value) {
      this.$emit('search', value)
    }
  }
}
</script>

<style>
</style>